<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLogisticsInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('logistics_info', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('rent_id')->comment('订单ID');
            $table->integer('type')->comment('1线上借衣2线上还衣3线上换购3线上退货');
            $table->integer('addr_id')->default(0)->comment('收货地址ID');
            $table->string('com_no')->default('')->comment('物流公司编号');
            $table->string('logistics_no')->default('')->comment('物流单号');
            $table->string('out_order_no')->default('')->comment('业务方订单号');
            $table->integer('send_time')->default()->comment('发货时间');
            $table->integer('receive_time')->default()->comment('收货时间');
            
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `logistics_info` comment '物流订单表';");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('logistics_info');
    }
}
